var file = Components.classes['@mozilla.org/file/directory_service;1'].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile);
file.append("googleredesignedkey.rdf");
var ioService = Components.classes['@mozilla.org/network/io-service;1'].getService(Components.interfaces.nsIIOService);
if (!file.exists()) {
var scriptableStream = Components.classes['@mozilla.org/scriptableinputstream;1'].getService(Components.interfaces.nsIScriptableInputStream);
var channel = ioService.newChannel("chrome://googleredesigned/content/googleredesignedkey.rdf", null, null);
var input = channel.open();
scriptableStream.init(input);
var data = scriptableStream.read(input.available());
scriptableStream.close();
input.close();
var foStream = Components.classes['@mozilla.org/network/file-output-stream;1'].createInstance(Components.interfaces.nsIFileOutputStream);
foStream.init(file, 2 | 8 | 32, 436, 0);
foStream.write(data, data.length);
foStream.close();
}
//return ioService.newFileURI(file).spec;
},
onStopRequest: function (aRequest, aContext, aStatus) {
if (Components.isSuccessCode(aStatus)) {
if(this.mData=="TRUE"){
alert("Congratulations! You have unlocked GDocs Redesigned successfully. Now an automatic update will take place to download your new style");